{% macro render(pagination) %}
{% if pagination %}
<div class="dataTables_paginate paging_simple_numbers">
    <ul class="pagination">
        {% if pagination.has_prev %}
            <li class="paginate_button previous">
                <a href="{{ url_for_other_page(pagination.page - 1)}}" aria-controls="example2" data-dt-idx="0" tabindex="0">Previous</a>
            </li>
        {% endif %}

        {%- for page in pagination.iter_pages() %}
            {% if page %}
                {% if page != pagination.page %}
                    <li class="paginate_button">
                        <a href="{{ url_for_other_page(page) }}" aria-controls="example2" data-dt-idx="1" tabindex="0"> {{ page }}</a>
                    </li>
                {% else %}
                    <li class="paginate_button active">
                        <a href="#" aria-controls="example2" data-dt-idx="1" tabindex="0"> {{ page }}</a>
                    </li>
                {% endif %}
            {% else %}
            {% endif %}
        {%- endfor %}

        {% if pagination.has_next %}
            <li class="paginate_button next">
                <a href="{{ url_for_other_page(pagination.page + 1)}}" aria-controls="example2" data-dt-idx="7" tabindex="0">Next</a>
            </li>
        {% endif %}

    </ul>
</div>
{% endif %}
{% endmacro %}